package org.iris.plugin.util

import net.mamoe.mirai.utils.verbose
import org.iris.plugin.HitHit
import java.util.*

val inActive = mutableSetOf<String>()

class AutoClear(private val imgName: String) : TimerTask() {
    override fun run() {
        val cache = HitHit.dataFolder.resolve("tmp").resolve(imgName)
        runCatching {
            if (!cache.delete()) HitHit.logger.verbose { "缓存清理失败，原因: 无法找到$imgName" }
        }
        inActive.remove(imgName)
    }
}